import Vue from "vue";
require("../../utils/oldcommon/layer");
let funcBanner = {};
funcBanner.Temp = `
<div class="management_features">
    <template v-if=" mananger==true">
    <div class="management">
        <a href="#" v-on:click="complaints">
            <div>
                <img src="../../../img/common/complaint.png" alt="">
            </div>
            <p>投诉</p>
        </a>
    </div>
    <div class="management">
        <a href="javascript:;" v-on:click="qrcode">
            <div class="qrcode">
                    <img src="../../../img/common/qrcode.png" alt="">
            </div>
            <p>二维码</p>
        </a>
    </div>
    <div class="management">
        <a href="#">
            <div>
                <img src="../../../img/common/goupold.png" alt="">
            </div>
            <p>回顶部</p>
        </a>
    </div>
    </template>
    <template v-else>
      <div class="management">
          <a href="javascript:;" v-on:click="levelEnsure">
              <div>
                  <img src="../../../img/common/management.png" alt="">
              </div>
              <p>管理</p>
          </a>
      </div>
    </template>
</div>
`;
let FuncBanner = Vue.extend({
  template: funcBanner.Temp,
  props: ["mananger"],
  methods: {
    complaints:function(){
      window.location="/dist/special/complaints.html"+window.location.search;
    },
    qrcode: function () {
      window.location="../qrcode/qrcode_business.html"+window.location.search;
    },
    levelEnsure:function () {
      layer.open({
        content: '！活动详情保存提示,如需保存当前活动内容，请点击页面下方先保存活动内容后再选择[确认已保存].'
        ,btn: ['确认已保存,进入用户中心', '留下继续编辑']
        ,yes: function(index){
          layer.close(index);
          window.location.href='../../user_page/user_center.html';
        },no:function(index){
          layer.close(index);
        }
      });
    }
  }
});
export default FuncBanner;
